import { WebGLUtils, Matrix4 } from "./lib"
import { readOBJtoMesh, readShaderFile } from './dev/utils'
import { OBJ } from "webgl-obj-loader";

const canvas = document.getElementById("webgl");

if (!canvas) {
	console.log("失败获取canvas");
} else {
	console.log("canvas成功获取！");
}

const twoDcontext = (<HTMLCanvasElement>canvas).getContext("2d");
const gl = (<HTMLCanvasElement>canvas).getContext('webgl')

twoDcontext.fillStyle = "rgba(0,0,255,1.0)";
twoDcontext.fillRect(10, 10, 150, 150);


async function main() {
	const [vs, fs] = await readShaderFile('../public/t');
	const mesh = await readOBJtoMesh('../public/jinglingqiu.obj')
	OBJ.initMeshBuffers(gl,mesh);
}

